<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.test.util.PageUtil"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>公告管理</title>
<link href="css/common.css" rel="stylesheet" type="text/css" />
<link href="css/userm.css" rel="stylesheet" type="text/css" />
</head>
<body>

	<div id="top">
		<div class="tmenu">
			<span><a href="index!shows.action">首页</a>
			</span><span>|</span> <span><a href="userm.jsp">用户中心</a>
			</span> <span><a href="loginout.jsp">退出</a>
			</span>
		</div>
		<div class="logo">
			<a href="show!show.action"><img src="images/logo.gif" />
			</a>
		</div>

	</div>

	<div id="main">
		<div class="main_right" id="page" align="center">
			<div style="margin-right:-300px;">
				<h1>公告管理</h1>
			</div>
			<div style="width:100%; height:60%; margin-right:-230px;">
				<c:forEach items="${list}" var="news">
					<div
						style="border-bottom:2px dashed #FFFFFF; width:80%; height:35%; margin-top: 20px;">
						<div align="left">
							<h2>${news.title}</h2>
						</div>
						<div align="center"
							style="margin-top: 10px; height:50%; font-size: 16px;">${news.content}</div>
						<div align="right">${news.newsTime}</div>
					</div>
				</c:forEach>
				<%
					PageUtil pageUtil = (PageUtil) request.getAttribute("pageUtil");
					int currentPage = 0;
					int allPage = 0;
					int nextPage = 0;
					int lastPage = 0;
					if (null != pageUtil) {
						currentPage = pageUtil.getCurrentPage();
						allPage = pageUtil.getAllPage();

						nextPage = (currentPage + 1 > allPage) ? allPage
								: (currentPage + 1);
						lastPage = (currentPage - 1 < 1) ? 1 : (currentPage - 1);
					}
				%>
				<div>
					<a href="news!NewsDetail.action?curpage1=1">首页</a>&nbsp;&nbsp; <a
						href="news!NewsDetail.action?curpage1=<%=lastPage%>">上页</a>&nbsp;&nbsp;
					<a href="news!NewsDetail.action?curpage1=<%=nextPage%>">下页</a>&nbsp;&nbsp;
					<a href="news!NewsDetail.action?curpage1=${pageUtil.allPage}">末页</a>&nbsp;&nbsp;
					<a href="#">第${pageUtil.currentPage}页/共${pageUtil.allPage}页</a>
				</div>
			</div>
		</div>

	</div>

	<div id="footer"></div>
</body>
</html>
